﻿//
// Created: 2018/7/16
// Author: chenqiang
//
using System.Data.Entity;
using System.Data.Entity.ModelConfiguration;
using Model.WeiXin;

namespace Model.WeiXin.Map
{
    internal class WeiXinUserMap : EntityTypeConfiguration<WeiXinUser>
    {
        public WeiXinUserMap()
        {
            this.ToTable("WeiXin_User");
            this.HasKey(i => new { i.UserID });
            this.Property(i => i.UserID).HasColumnName("UserID");
            this.Property(i => i.GradeID).HasColumnName("GradeID");
            this.Property(i => i.UserCode).HasColumnName("UserCode");
            this.Property(i => i.Account).HasColumnName("Account");
            this.Property(i => i.Password).HasColumnName("Password");
            this.Property(i => i.OpenId).HasColumnName("OpenId");
            this.Property(i => i.NickName).HasColumnName("NickName");
            this.Property(i => i.WXAccount).HasColumnName("WXAccount");
            this.Property(i => i.Area).HasColumnName("Area");
            this.Property(i => i.HeadUrl).HasColumnName("HeadUrl");
            this.Property(i => i.ParentID).HasColumnName("ParentID");
            this.Property(i => i.IDPath).HasColumnName("IDPath");
            this.Property(i => i.CreateTime).HasColumnName("CreateTime");
            this.Property(i => i.State).HasColumnName("State");
            this.Property(i => i.ProjectID).HasColumnName("ProjectID");
            this.Property(i => i.Email).HasColumnName("Email");
            this.Property(i => i.Sex).HasColumnName("Sex");
            this.Property(i => i.BirthDay).HasColumnName("BirthDay");
            this.Property(i => i.IsAutoSynchro).HasColumnName("IsAutoSynchro");
            this.Property(i => i.TJCode).HasColumnName("TJCode");
            this.Property(i => i.RegisterSource).HasColumnName("RegisterSource");
            this.Property(i => i.TotalSaleMoney).HasColumnName("TotalSaleMoney");
            this.Property(i => i.TotalBonusMoney).HasColumnName("TotalBonusMoney");
            this.Property(i => i.BonusBalance).HasColumnName("BonusBalance");
            this.Property(i => i.TotalRequestMoney).HasColumnName("TotalRequestMoney");
            this.Property(i => i.ScoreBalance).HasColumnName("ScoreBalance");
            this.Property(i => i.FrozenBalance).HasColumnName("FrozenBalance");
            this.Property(i => i.FrozenScore).HasColumnName("FrozenScore");
            this.Property(i => i.UnionId).HasColumnName("UnionId");
            this.Property(i => i.ExpireTime).HasColumnName("ExpireTime");
            this.Property(i => i.CompanyName).HasColumnName("CompanyName");
            this.Property(i => i.UserName).HasColumnName("UserName");
            this.Property(i => i.IDCard).HasColumnName("IDCard");
            this.Property(i => i.Mobile).HasColumnName("Mobile");
            this.Property(i => i.PayPwd).HasColumnName("PayPwd");
            this.Property(i => i.IsFocus).HasColumnName("IsFocus");
            this.Property(i => i.FocusTime).HasColumnName("FocusTime");
            this.Property(i => i.CancelTime).HasColumnName("CancelTime");
            this.Property(i => i.IsTrade).HasColumnName("IsTrade");
            this.Property(i => i.IsRealAuth).HasColumnName("IsRealAuth");
            this.Property(i => i.IsGoldAuth).HasColumnName("IsGoldAuth");
            this.Property(i => i.IsCompanyAuth).HasColumnName("IsCompanyAuth");
            this.Property(i => i.IsAuth).HasColumnName("IsAuth");
            this.Property(i => i.RedOpenId).HasColumnName("RedOpenId");
            this.Property(i => i.PayOpenId).HasColumnName("PayOpenId");
            this.Property(i => i.AuthOpenId).HasColumnName("AuthOpenId");
            this.Property(i => i.MsgOpenId).HasColumnName("MsgOpenId");
            this.Property(i => i.LastLoginTime).HasColumnName("LastLoginTime");
            this.Property(i => i.IsMobileAuth).HasColumnName("IsMobileAuth");
        }
    }

    public static class WeiXinUserMapExtensions
    {
        public static void UserWeiXinUserMap(this DbModelBuilder pModelBuilder)
        {
            pModelBuilder.Configurations.Add(new WeiXinUserMap());
        }
    }
}